import java.util.Arrays;
import java.util.Scanner;

public class Main {


    //第二题 幸运的袋子
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n =  in.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = in.nextInt();
        }
        int sum = 0;
        int pro = 1;
        int count = 0;
        Arrays.sort(arr);
        for (int i = 0; i < n - 1; i++) {
            for (int j = i; j < n - 1; j++) {
                sum += arr[j];
                pro *= arr[j];
                if (sum > pro) {
                    count++;
                }
            }


        }
        System.out.println(count);
    }

    //第一题日期转天数
  /*  public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int year = in.nextInt();
        int mouth = in.nextInt();
        int day = in.nextInt();

        int county = 0;
        int countm = 0;

        for(int i = 1; i < mouth; i++){

            if(i == 1 || i == 3 ||i == 5 ||i == 7 ||i == 8 ||i == 10){
                countm += 31;
            }
            if(i == 4 || i == 6 ||i == 9 ||i == 11){
                countm += 30;
            }
            if(i == 2){
                countm += 28;
            }


        }
        if((year % 4 == 0 && year % 100 != 0)|| year % 400 ==0){
            county = 1;
        }
        System.out.println(day+countm+county);
    }*/
}